package 笔试.网易;


/**
 * @author:谢君臣
 * @Date:2021/8/21-14:17
 * @version:1.0
 * @function:System.out.println(String.format("%.2f", max/2));
 */

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] strings = scanner.nextLine().split(" ");
        int m =scanner.nextInt(),res =0;
        for (int i = 0; i < strings.length; i++) {
            for (int j = i+1; j < strings.length; j++) {
                if (Integer.parseInt(strings[i])+Integer.parseInt(strings[j])<=m)
                    res++;
            }
        }
        System.out.println(res);
    }
}

























